using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace LynxWebLog.Areas.Pages.Controllers
{
    public class MediaController : Controller
    {
        //
        // GET: /Media/
        public async Task<FileContentResult> Get(Int32 id)
        {
            HttpClient client = ClientUtility.BlogAPIClient();
            HttpResponseMessage resp = await client.GetAsync("api/Media/" + id);
            resp.EnsureSuccessStatusCode();

            return await resp.Content.ReadAsAsync<FileContentResult>();
        }
	}
}